package com.itheima.order.controller;

import com.itheima.order.service.OrderService;
import com.itheima.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：mengw9
 * @date ：Created By 2020/9/21 20:22
 * @description：
 * @version:
 */

@RestController
@RequestMapping("/order")
public class OrderContrlloer {

    @Autowired
    private Environment environment;
    @Autowired
    OrderService orderService;



    @GetMapping()
    public List<Order> findAllOrder(){

//        String property = environment.getProperty("server.port");
//        System.out.println("property = " + property);


        return this.orderService.findAllOrder();

    }

}
